﻿using System;
using CIK.News.Domain;

namespace CIK.News.Web.Infrastructure.Security
{
    public class UserInfo
    {
        /// <summary>
        /// Get or set UserID
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// Get or set UserName
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// Get or set GroupID
        /// </summary>
        public int GroupId { get; set; }

        /// <summary>
        /// Get or set DisplayName
        /// </summary>
        public string DisplayName { get; set; }

        /// <summary>
        /// Get or set Email
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// Get or set DateCreated
        /// </summary>
        public DateTime DateCreated { get; set; }

        /// <summary>
        /// Get or set LastLoginTime
        /// </summary>
        public DateTime LastLoginTime { get; set; }

        public string Token { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="UserInfo"/> class.
        /// </summary>
        public UserInfo()
        {
            UserId = -1;
            UserName = string.Empty;
            DisplayName = string.Empty;
            Email = string.Empty;
            DateCreated = DateTime.Now;
            LastLoginTime = DateTime.Now;
            GroupId = -1;
        }

        public UserInfo(User user)
            : this()
        {
            UserName = user.UserName;
            DisplayName = user.DisplayName;
            Email = user.Email;
        }
    }
}